package lq;

import java.util.Scanner;

public class lq2007 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        long sqr,slr;
        int m,n,j,x;
        while (in.hasNext()){
            sqr=0;
            slr=0;
            m=in.nextInt();
            n=in.nextInt();
            if(m>n){
                x=m;
                m=n;
                n=x;
            }
            for (j=m;j<=n;j++){
                if (inprme(j)){
                    slr=slr+j*j*j;
                }
                else {
                    sqr=sqr+j*j;
                }
            }
            System.out.println(sqr+" "+slr);
        }
    }
    private static boolean inprme(int i){
        boolean flag=true;
        if (i%2==0){
            flag=false;
        }
        return flag;
    }
}
